import React, { Component } from 'react';
import './Swipe.scss'
import { swipe } from '../../utils/api'
import { Swiper } from 'antd-mobile'
class Swipe extends Component {
    constructor(props){
        super(props)
        this.state={
            imgList:[]
        }
    }
    componentDidMount(){
        swipe().then((res)=>{
           this.setState({
            imgList:res.data.list
           })
        })
    }detailsPage
    render() {
        return (
            <Swiper loop autoplay className='mySwiper'>
                {
                this.state.imgList.map((item,index)=>{
                    return(
                        <Swiper.Item key={index}>
                            <img src={item.pic} alt="" />
                        </Swiper.Item>
                    )
                })
            }
            </Swiper>
        );
    }
}

export default Swipe;